﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Text;
using nspLable.Function;
using System.IO;
using Base;
using System.Data.SqlClient;
using SqlOperate;
namespace nspLable.Function.Shops
{
    /// <summary>
    /// Shop 的摘要说明
    /// </summary>
    public class Shop
    {

        /// <summary>
        /// 获取方法名称
        /// </summary>
        /// <param name="parame"></param>
        /// <returns></returns>
        private static string tempTitle(string parame)
        {
            int nstart = parame.IndexOf("(");
            if (nstart > 0)
                return parame.Substring(0, nstart);
            else
                return parame;

        }


        /// <summary>
        /// 获取参数列表
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        private static string tempInfo(string str)
        {
            int nstart = str.IndexOf("(");
            int nend = str.IndexOf(")");
            if (nstart < 0 || nend < 0)
                return "";
            else
                return str.Substring(nstart + 1, nend - nstart - 1);
        }


        /// <summary>
        /// 标签替换
        /// </summary>
        /// <param name="Summary"></param>
        /// <returns></returns>
        public static string ReplaceLable(string LoginName, string strLable)
        {
            //查询内容
            string strSelect;
            strSelect = "top 1 U_UserInfo.*,U_VipGrade.Name,U_UserOperate.Template_New";
            //查询条件 
            string strWhere = "where LoginName= '" + LoginName + "' ";
            // 要查询表、视图
            string strTableName = "U_UserInfo left join U_VipGrade on U_UserInfo.GradeID=U_VipGrade.ID left join U_UserOperate on U_UserOperate.UserID=U_UserInfo.UserID";
            // 排序方式
            string strOrderBy = "";
            // 返回查询结果
            DataTable Lists = Function.GetDataTable(strSelect, strWhere.ToString(), strTableName, strOrderBy);
            StringBuilder strBuilder = new StringBuilder();
            switch (tempTitle(strLable).ToUpper())
            {
                case "TEMPNAME":
                    strBuilder.Append(Lists.Rows[0]["Template_New"].ToString());
                    break;
                case "COMPANYNAV":
                    string[] navarray = new string[] { "Index,首 页", "Profile,公司介绍", "Supply,供应产品", "Buy,求购信息", "Importers,诚信档案", "Certify,荣誉证书", "Job,人才招聘", "Contact,联系我们" };

                    string navlist = "";
                    for (int navl = 0; navl < navarray.Length; navl++)
                    {
                        string[] subnav = navarray[navl].Split(',');
                        string navcss = "nav1";
                        if (GetRequest.GetPageName().Replace(Base.BasePage.Config.Rewrite, "").ToLower() == subnav[0].ToLower()) navcss = "nav2";
                        navlist += "<li class=\"" + navcss + "\"><a title=\"{Shop_COMPANYNAME}" + subnav[1] + "\" href=\"{PB_WebURL}Shop/" + subnav[0] + "/{Shop_WebName}\">" + subnav[1] + "</a></li>\r\n";
                    }

                    strBuilder.Append(navlist);
                    break;
                case "COMPANYSUMMARY":  //CompanySummary
                    if  ( Base.Common.ClearHtml(Lists.Rows[0]["Summary"].ToString()).Length > 90)
                    {
                        strBuilder.Append(Base.Common.ClearHtml(Lists.Rows[0]["Summary"].ToString()).Substring(0, 90) + "...");
                    }
                    else { strBuilder.Append(Base.Common.ClearHtml(Lists.Rows[0]["Summary"].ToString())); }
                    break;
                case "ALLCOMPANYSUMMARY":  //CompanySummary
                    strBuilder.Append(Lists.Rows[0]["Summary"].ToString());
                    break;
                case "VIPGRADE":  //CompanySummary
                    strBuilder.Append(Lists.Rows[0]["Name"].ToString());
                    break;
                case "LOGO":
                    if (Lists.Rows[0]["Logo"].ToString() != "")
                    {
                        strBuilder.Append(@"<img width='120' height='80' src='");
                        strBuilder.Append(Function.ProcessImageUrl(Lists.Rows[0]["Logo"].ToString()));
                        strBuilder.Append(@"'>");
                    }
                    else
                        strBuilder.Append("");
                    break;
                case "COMPANYNAME":                     //公司名称
                    strBuilder.Append(Lists.Rows[0]["CompanyName"].ToString());
                    break;
                case "SUPPLY":                          //供应
                    strBuilder.Append(Supply(Lists.Rows[0]["UserID"].ToString()));
                    break;
                case "JOB":                            //人才招聘
                    strBuilder.Append(JobList(Lists.Rows[0]["UserID"].ToString(),LoginName));
                    break;
                case "WEBNAME":                         //商铺名称
                    strBuilder.Append(Lists.Rows[0]["LoginName"].ToString() + Base.BasePage.Config.Rewrite);
                    break;
                case "RECOMMEND":   //精品推荐
                    strBuilder.Append(Recommend(Lists.Rows[0]["UserID"].ToString(), 1));
                    break;
                case "CONTACT":                         // 联系方式
                    strBuilder.Append(Contact(Convert.ToInt32(Lists.Rows[0]["UserID"].ToString())));
                    break;
                case "LINK_ROW":                        //友情链接竖排
                    strBuilder.Append(Link_Row(Convert.ToInt32(Lists.Rows[0]["UserID"].ToString())));
                    break;
                case "CERTIFY":                         //公司证书 
                    strBuilder.Append(Certify(Convert.ToInt32(Lists.Rows[0]["UserID"].ToString())));
                    break;
                case "PRODUCTTYPE":                     //产品分类
                    strBuilder.Append(ProductType(Convert.ToInt32(Lists.Rows[0]["UserID"].ToString()), LoginName));
                    break;
                case "NEWSLIST":                        //公司新闻
                    string param = "6";
                    string sType = "1";
                    string str = tempInfo(strLable);
                    param = str.Substring(0, str.IndexOf(","));
                    sType = str.Substring(str.IndexOf(",") + 1);
                    strBuilder.Append(NewsList(Convert.ToInt32(Lists.Rows[0]["UserID"].ToString()), LoginName, param, sType));
                    //strBuilder.Append("fh");

                    break;
                case "DETAILEADDRESS":                  //公司详细地址
                    strBuilder.Append(Lists.Rows[0]["Country"].ToString());
                    strBuilder.Append(Lists.Rows[0]["Province"].ToString());
                    strBuilder.Append(Lists.Rows[0]["City"].ToString());
                    strBuilder.Append(Lists.Rows[0]["Area"].ToString());
                    strBuilder.Append(Lists.Rows[0]["Street"].ToString());
                    break;
                case "COMPANYINFO":                    //公司详细信息
                    strBuilder.Append(CompanyInfo(Lists));
                    break;
                case "SEARCHKEY":                     // 站内搜索
                    strBuilder.Append(Search(LoginName));
                    break;
                case "HOMEPAGE":                     //设为首页
                    strBuilder.Append("<a onMouseDown=\"return hcclick('?hctracelog=newsswindex')\"");
                    strBuilder.Append("onclick=\"javascript:this.style.behavior='url(#default#homepage)';");
                    strBuilder.Append("this.setHomePage('{PB_WebURL}Shop/Index/{Shop_WebName}.shtml')\" title=\"设为主页\" style=\"cursor:pointer;\">设为首页</a> | ");
                    strBuilder.Append("<a href=\"{PB_WebURL}Search/SaveFavorites" + Base.BasePage.Config.Rewrite + "?id=" + Lists.Rows[0]["UserID"] + "&Type=company\">收藏此企业</a>");
                    break;
                case "BOTTOM":
                    strBuilder.Append(Bottom(Lists));
                    break;
                case "NEWSINFO":
                    strBuilder.Append(NewsInfo(Lists.Rows[0]["UserID"].ToString()));
                    break;
                case "MINOHEADER":
                    strBuilder.Append(MinoHeader(Convert.ToInt32(Lists.Rows[0]["UserID"].ToString())));
                    break;
                case "企业档案":
                    strBuilder.Append(GetCompMesg(Convert.ToInt32(Lists.Rows[0]["UserID"].ToString()),1));
                    break;
                case "MINOLOGO":
                    if (Lists.Rows[0]["Logo"].ToString() != "")
                    {
                        strBuilder.Append(@"<img  src='");
                        strBuilder.Append(Function.ProcessImageUrl(Lists.Rows[0]["Logo"].ToString()));
                        strBuilder.Append(@"'>");
                    }
                    else
                        strBuilder.Append("");
                    break;
                case "MINOPRODUCTTYPE":                     //产品分类
                    strBuilder.Append(MinoProductType(Convert.ToInt32(Lists.Rows[0]["UserID"].ToString()), LoginName));
                    break;
                case "友情链接":
                    strBuilder.Append(MinoFriendLink(Convert.ToInt32(Lists.Rows[0]["UserID"].ToString())));
                    break;
                case "联系我们":
                    strBuilder.Append(GetCompMesg(Convert.ToInt32(Lists.Rows[0]["UserID"].ToString()), 2));
                    break;
                case "最新供应":
                    strBuilder.Append(MinoTopSupply(Lists.Rows[0]["UserID"].ToString(), 8, LoginName));
                    break;
                case "精品橱窗":
                    strBuilder.Append(MinoPutSupply(Lists.Rows[0]["UserID"].ToString(), 8, LoginName));
                    break;
                case "详细信息":
                    strBuilder.Append(MinoDetailinformation(Lists.Rows[0]["UserID"].ToString(),LoginName));
                    break;
                case "供应产品自定义分类":
                    strBuilder.Append(MinoCustomclass(Convert.ToInt32(Lists.Rows[0]["UserID"].ToString()), LoginName,"Supply"));
                    break;
                case "求购产品自定义分类":
                    strBuilder.Append(MinoBuyCustomclass(Convert.ToInt32(Lists.Rows[0]["UserID"].ToString()), LoginName));
                    break;
                case "供应产品":
                    strBuilder.Append(MinoSupplyPro(Convert.ToInt32(Lists.Rows[0]["UserID"].ToString()), LoginName));
                    break;
                case "求购产品":
                    strBuilder.Append(MinoBuyPro(Convert.ToInt32(Lists.Rows[0]["UserID"].ToString()), LoginName));
                    break;
                case "显示类型":
                    int stype = 1;
                    if (HttpContext.Current.Request.QueryString["showtype"] != null)
                    {
                        stype = int.Parse(HttpContext.Current.Request.QueryString["showtype"].ToString());
                    }
                    strBuilder.Append(stype);
                    break;
                case "分类ID":
                    int protype = 0;
                    if (HttpContext.Current.Request.QueryString["Type"] != null)
                    {
                        protype = int.Parse(HttpContext.Current.Request.QueryString["Type"].ToString());
                    }
                    strBuilder.Append(protype);
                    break;
                case "LOGINNAME":
                    strBuilder.Append(LoginName);
                    break;
                case "求购商品分类":
                    strBuilder.Append(MinoBuyProClass(Convert.ToInt32(Lists.Rows[0]["UserID"].ToString()), LoginName));
                    break;
                default:
                    strBuilder.Append("无此内容！");
                    break;
            }
            return strBuilder.ToString();
        }
        private static string MinoSupplyPro(int UserID, string LoginName)
        {
            int strType = 0;
            string keyword = "";
            int showtype = 1;
            if (HttpContext.Current.Request.QueryString["Type"] != null)
            {
                if (GetRequest.CheckQueryStringisInt("Type"))
                    strType = int.Parse(HttpContext.Current.Request.QueryString["Type"].ToString());
            }
            if (HttpContext.Current.Request.QueryString["keyword"] != null)
            {
                keyword =System.Web.HttpUtility.UrlDecode( HttpContext.Current.Request.QueryString["keyword"]).ToString();
            }
            if (HttpContext.Current.Request.QueryString["showtype"] != null)
            {
                showtype = int.Parse(HttpContext.Current.Request.QueryString["showtype"].ToString());
            }
            //查询内容
            string strSelect;
            int PageSize = 8;
                        int PageIndex = 0;
            if (HttpContext.Current.Request.QueryString["Page"] != null)
                PageIndex = Convert.ToInt32(HttpContext.Current.Request.QueryString["Page"]);
            if (PageIndex < 1) PageIndex = 1;
            strSelect = " * ";
            //查询条件 
            string strWhere = " Verify=1 and (datediff(hh,EndDate,getdate())<0) and UserID= " + UserID + " ";
            
            if (strType != 0)
            {
                strWhere += " and ProType=" + strType;
            }
            if (keyword != "")
            {
                strWhere += " and Name like '%" + keyword + "%'";
            }

            // 要查询表、视图
            string strTableName = " C_Supply ";
            // 排序方式
            string strOrderBy = " ";
            string OrderField = " AddDate ";
            int OrderType = 1;
            int Count = 0;
            // 返回查询结果
            DataTable Lists = nspLable.Function.Pagination.GetDataTable(strWhere, strTableName, OrderType, OrderField, strSelect, PageSize, PageIndex, Count, "ID");
            StringBuilder strBuilder = new StringBuilder();
            strBuilder.Append("<ul class=\"sprd1\">");

            foreach (DataRow dr in Lists.Rows)
            {
                string sptitle = dr["Name"].ToString();
                if (sptitle.Length > 20)
                {
                    sptitle = sptitle.Substring(0, 20);
                }
                string spInfo =Base.Common.ClearHtml(dr["Info"].ToString());
                if (spInfo.Length > 60)
                {
                    spInfo.Substring(0, 60);
                }

                strBuilder.Append("<li>");
                strBuilder.Append("<p class=\"tu\"><a title=\"\" href=\"{PB_WebURL}Supply/Detail-" + dr["ID"].ToString() + Base.BasePage.Config.Rewrite + "\"><img alt=\"\" src=\"" + Function.ProcessImageUrl(dr["Thumbnail"].ToString()) + "\" /></a></p>");
                strBuilder.Append("<p class=\"lt\">");
                strBuilder.Append("<span class=\"tit\"><a title=\"\" href=\"{PB_WebURL}Supply/Detail-" + dr["ID"].ToString() + Base.BasePage.Config.Rewrite + "\">" + sptitle + "</a></span>");
                strBuilder.Append("<em class=\"date\">"+dr["AddDate"]+"</em>");
                strBuilder.Append("<span class=\"nr\">" + spInfo + "</span>");
                strBuilder.Append("</p>");
                strBuilder.Append("<p class=\"rt\">");
                strBuilder.Append("<span class=\"rt1\"><a title=\"\" href=\"{PB_WebURL}Shop/Contact/{Shop_WebName}\">联系方式</a></span>");
                strBuilder.Append("<span class=\"rt2\"><a title=\"\" href=\"{PB_WebUrl}Search/Inquiry.aspx?type=supply&cpid=" + dr["ID"].ToString() + "\">点此询价</a></span>");
                strBuilder.Append("</p></li>");

            }
            strBuilder.Append("</ul>");

            string strUrl = Base.BasePage.Config.WebURL + "Shops/Supply" + Base.BasePage.Config.Rewrite + "?LoginName=" + LoginName + "&Type=" + strType;

            if (keyword != "")
            {
                strUrl += "&keyword=" + keyword;
            }
            strUrl += "&showtype=" + showtype;
            strUrl += "&Page=";
            string Pages = Pagination.GoToPagerCompany(PageIndex, PageSize, strUrl, strWhere, strTableName);
            strBuilder.Append(Pages);

            return strBuilder.ToString();

        }

        private static string MinoBuyPro(int UserID, string LoginName)
        {
            int strType = 0;
            string keyword = "";
            int showtype = 1;
            if (HttpContext.Current.Request.QueryString["Type"] != null)
            {
                if (GetRequest.CheckQueryStringisInt("Type"))
                    strType = int.Parse(HttpContext.Current.Request.QueryString["Type"].ToString());
            }
            if (HttpContext.Current.Request.QueryString["keyword"] != null)
            {
                keyword = System.Web.HttpUtility.UrlDecode(HttpContext.Current.Request.QueryString["keyword"]).ToString();
            }
            if (HttpContext.Current.Request.QueryString["showtype"] != null)
            {
                showtype = int.Parse(HttpContext.Current.Request.QueryString["showtype"].ToString());
            }
            //查询内容
            string strSelect;
            int PageSize = 8;
            int PageIndex = 0;
            if (HttpContext.Current.Request.QueryString["Page"] != null)
                PageIndex = Convert.ToInt32(HttpContext.Current.Request.QueryString["Page"]);
            if (PageIndex < 1) PageIndex = 1;
            strSelect = " * ";
            //查询条件 
            string strWhere = " Verify=1 and (datediff(hh,EndDate,getdate())<0) and UserID= " + UserID + " ";

            if (strType != 0)
            {
                strWhere += " and patindex('%,'+rtrim( " + strType + ")+',%',','+ IndType+',')>0 ";
            }
            if (keyword != "")
            {
                strWhere += " and Name like '%" + keyword + "%'";
            }

            // 要查询表、视图
            string strTableName = " C_Purchase ";
            // 排序方式
            string strOrderBy = " ";
            string OrderField = " AddDate ";
            int OrderType = 1;
            int Count = 0;
            // 返回查询结果
            DataTable Lists = nspLable.Function.Pagination.GetDataTable(strWhere, strTableName, OrderType, OrderField, strSelect, PageSize, PageIndex, Count, "ID");
            StringBuilder strBuilder = new StringBuilder();
            strBuilder.Append("<ul class=\"sprd1\">");

            foreach (DataRow dr in Lists.Rows)
            {
                string sptitle = dr["Name"].ToString();
                if (sptitle.Length > 20)
                {
                    sptitle = sptitle.Substring(0, 20);
                }
                string spInfo = Base.Common.ClearHtml(dr["Info"].ToString());
                if (spInfo.Length > 60)
                {
                    spInfo.Substring(0, 60);
                }

                strBuilder.Append("<li>");
                strBuilder.Append("<p class=\"tu\"><a title=\"\" href=\"{PB_WebURL}Purchase/Detail-" + dr["ID"] +Base.BasePage.Config.Rewrite+ "\"><img alt=\"\" src=\"" + Function.ProcessImageUrl(dr["Thumbnail"].ToString()) + "\" /></a></p>");
                strBuilder.Append("<p class=\"lt\">");
                strBuilder.Append("<span class=\"tit\"><a title=\"\" href=\"{PB_WebURL}Purchase/Detail-" + dr["ID"] + Base.BasePage.Config.Rewrite + "\">" + sptitle + "</a></span>");
                strBuilder.Append("<em class=\"date\">" + dr["AddDate"] + "</em>");
                strBuilder.Append("<span class=\"nr\">" + spInfo + "</span>");
                strBuilder.Append("</p>");
                strBuilder.Append("<p class=\"rt\">");
                strBuilder.Append("<span class=\"rt1\"><a title=\"\" href=\"{PB_WebURL}Shop/Contact/{Shop_WebName}\">联系方式</a></span>");
                strBuilder.Append("<span class=\"rt2\"><a title=\"\" href=\"{PB_WebUrl}Search/Inquiry.aspx?type=supply&cpid=" + dr["ID"].ToString() + "\">点此询价</a></span>");
                strBuilder.Append("</p></li>");

            }
            strBuilder.Append("</ul>");

            string strUrl = Base.BasePage.Config.WebURL + "Shops/Buy" + Base.BasePage.Config.Rewrite + "?LoginName=" + LoginName + "&Type=" + strType;

            if (keyword != "")
            {
                strUrl += "&keyword=" + keyword;
            }
            strUrl += "&showtype=" + showtype;
            strUrl += "&Page=";
            string Pages = Pagination.GoToPagerCompany(PageIndex, PageSize, strUrl, strWhere, strTableName);
            strBuilder.Append(Pages);

            return strBuilder.ToString();

        }

        private static string MinoDetailinformation(string UserID, string LoginName)
        {

            //查询内容
            string strSelect;
            strSelect = " * ";
            //查询条件 
            string strWhere = " where UserID= " + UserID + " ";
            // 要查询表、视图
            string strTableName = " U_UserInfo ";
            // 排序方式
            string strOrderBy = " ";
            // 返回查询结果
            DataTable Lists = nspLable.Function.Function.GetDataTable(strSelect, strWhere, strTableName, strOrderBy);
            StringBuilder strBuilder = new StringBuilder();
            foreach (DataRow dr in Lists.Rows)
            {
                string itype = GetIndustryType(dr["Industry"].ToString());
                strBuilder.Append("<div class=\"spc3\">");
                strBuilder.Append("<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"sptb\">");
                strBuilder.Append("<tr>");
                strBuilder.Append("<td width=\"16%\" class=\"zi1\">主营产品或服务：</td>");
                strBuilder.Append("<td width=\"34%\">" + dr["Product"] + "</td>");
                strBuilder.Append("<td width=\"16%\" class=\"zi1\">主营行业：</td>");
                strBuilder.Append("<td>" + itype + "</td>");
                strBuilder.Append("</tr>");
                strBuilder.Append("<tr><td class=\"zi1\">企业类型：</td>");
                strBuilder.Append("<td>" + dr["CompanyNature"] + "</td>");
                strBuilder.Append("<td class=\"zi1\">经营模式：</td>");
                strBuilder.Append("<td>" + dr["BusinessModel"] + "</td></tr>");
                strBuilder.Append("<tr><td class=\"zi1\">注册资本：</td>");
                strBuilder.Append("<td>" + dr["Capital"] + "</td>");
                strBuilder.Append("<td class=\"zi1\">注册地址：</td>");
                strBuilder.Append("<td>" + dr["RegisterAddress"] + "</td></tr>");
                strBuilder.Append("<tr><td class=\"zi1\">公司成立时间：</td><td>" + dr["Established"] + "</td>");
                strBuilder.Append("<td class=\"zi1\">法定代表人/负责人：</td><td>" + dr["Corporate"] + "</td></tr>");
                strBuilder.Append("<tr><td class=\"zi1\">主要经营地点：</td><td colspan=\"3\">" + dr["DealinAdd"] + "</td></tr>");

                strBuilder.Append("<tr><td class=\"zi1\">公司主页：</td><td colspan=\"3\">" + dr["URL"] + "</td></tr>");
                strBuilder.Append("</table></div>");
                
            }
            return strBuilder.ToString();
        }
        private static string GetIndustryType(string ids)
        {
            string retVal = "";
            SqlParameter[] param = new SqlParameter[] 
            {
                new SqlParameter("@ids", ids)
            };
            DataTable dt = SqlHelper.ExecuteTable(CommandType.StoredProcedure, "SP_W_selectIndustryType", param);
            if (dt.Rows.Count != 0)
            {
                retVal = dt.Rows[0]["industryType"].ToString();
            }
            return retVal;
        }
        /// <summary>
        /// 头部
        /// </summary>
        /// <param name="UserID">id</param>
        /// <returns></returns>
        private static string MinoHeader(int UserID)
        {
            StringBuilder strBuilder = new StringBuilder();

            strBuilder.Append(@"<div class=""top""><div class=""cot"">");
            if (Base.BasePage.CheckCookies())
            {
                strBuilder.Append(@"<p class=""toprt"" ><span class=""f_c00"">");
                strBuilder.Append(@"" + Base.GetRequest.GetCookie("LoginName") + "");
                strBuilder.Append(@"</span>您好，欢迎您的光临 [<a title=""提交企业信息"" class=""l_c00"" href=""{PB_WebURL}Member/Index.aspx"">提交企业信息</a>]  [<a title="""" class=""l_c00"" onclick='delCookie(""LoginName"")'>退出</a>]</p>");
            }
            else
            {
                strBuilder.Append("<p class=\"toprt\">您好，欢迎您的光临[<a title=\"登录\" href=\"{PB_WebURL}Login/Login.aspx\" class=\"l_c00\">登录</a>][<a title=\"提交企业信息\" href=\"{PB_WebURL}Member/Index.aspx\" class=\"l_c00\">提交企业信息</a>]<a title=\"帮助中心\" href=\"#\">帮助中心</a></p>");
            }
            strBuilder.Append(@"</div></div>");
            strBuilder.Append("<div class=\"cot\">");
            strBuilder.Append("<div class=\"top2 mar_top\">");
            strBuilder.Append("<p class=\"logo\"><a title=\"浙商黄页-商记\" href=\"{PB_WebURL}\"><img alt=\"浙商黄页-商记\" src=\"{PB_WebURL}images/logo.gif\" /></a></p>");
            strBuilder.Append("<p class=\"lline\"></p>");
            strBuilder.Append("<strong class=\"logo2\">{Shop_CompanyName}</strong>");
            strBuilder.Append("</div>");
            strBuilder.Append("</div>");
            string str = strBuilder.ToString();
            return str;
        }
        private static string MinoPutSupply(string UserID, int SelNum, string LoginName)
        {
            //查询内容
            string strSelect;
            strSelect = " top 8 * ";
            //查询条件 
            string strWhere = " where UserID= " + UserID + " and Verify=1 and Recommend=1";
            // 要查询表、视图
            string strTableName = " C_Supply ";
            // 排序方式
            string strOrderBy = " ";
            // 返回查询结果
            DataTable Lists = nspLable.Function.Function.GetDataTable(strSelect, strWhere, strTableName, strOrderBy);
            StringBuilder strBuilder = new StringBuilder();
            foreach (DataRow dr in Lists.Rows)
            {

                string supplyTitle = dr["Name"].ToString();
                if (supplyTitle.Length > 21)
                {
                    supplyTitle = supplyTitle.Substring(0, 21);
                }
                strBuilder.Append("<li>");
                strBuilder.Append("<p><a title=\"\" href=\"{PB_WebURL}Supply/Detail-" + dr["ID"].ToString()+Base.BasePage.Config.Rewrite + "\"><img alt=\"\" src=\"" + Function.ProcessImageUrl(dr["Thumbnail"].ToString()) + "\" /></a></p>");
                strBuilder.Append("<span><a title=\"" + dr["Name"] + "\" href=\"{PB_WebURL}Supply/Detail-" + dr["ID"].ToString() + Base.BasePage.Config.Rewrite + "\">" + supplyTitle + "</a></span>");
                strBuilder.Append("<em>" + dr["AddDate"] + "</em>");
                strBuilder.Append("</li>");
            }
            return strBuilder.ToString();
        }

        private static string MinoTopSupply(string UserID, int SelNum, string LoginName)
        {

            string strType = "";
            string strKey = "";
            string lname = "websen";

            string price = "";
            int price1 = 0;
            int price2 = 0;
            string prestr = "";

            string pName = "";//站内搜索 产品名

            //if (HttpContext.Current.Request.QueryString.AllKeys.Length == 2)
            //{
            if (GetRequest.CheckQueryStringisInt("Type"))
                strType = HttpContext.Current.Request.QueryString["Type"].ToString();
            else if (HttpContext.Current.Request.QueryString["keywords"] != "" && HttpContext.Current.Request.QueryString["keywords"] != null)
                strKey = HttpContext.Current.Request.QueryString["keywords"].ToString();
            else if (HttpContext.Current.Request.QueryString["pname"] != "" && HttpContext.Current.Request.QueryString["pname"] != null)
            {
                pName = HttpContext.Current.Request.QueryString["pname"].ToString();
            }
            else if (GetRequest.CheckQueryStringisInt("pre1"))
            {
                price1 = Convert.ToInt32(HttpContext.Current.Request.QueryString["pre1"].ToString());
            }
            else if (GetRequest.CheckQueryStringisInt("pre2"))
            {
                price2 = Convert.ToInt32(HttpContext.Current.Request.QueryString["pre2"].ToString());
            }
            else if (HttpContext.Current.Request.QueryString["pre"] != "" && HttpContext.Current.Request.QueryString["pre"] != null)
                price = HttpContext.Current.Request.QueryString["pre"].ToString();


            string[] pr = price.Split('^');
            if (pr.Length > 1)
            {
                if (pr[0] == "" || pr[0] == null)
                {
                    price1 = 0;
                }
                else
                {
                    price1 = Convert.ToInt32(pr[0]);
                }
                if (pr[1] == "" || pr[1] == null)
                {
                    price2 = 0;
                }
                else
                {
                    price2 = Convert.ToInt32(pr[1]);
                }
            }

            if ((price1 + price2) > 0)
            {
                if (price1 < price2) prestr = " and Price >= " + price1 + " AND Price <= " + price2;
                else if (price2 == 0 && price1 > price2) prestr = " and [Price]> " + price1 + "";
                else if (price1 > price2) prestr = " and Price <= " + price1 + " AND Price >= " + price2;
                else prestr = "and Price = " + price1;
            }
            //}
            int Num = 8;         //共显示的条数
            if (SelNum != 0)
            {
                Num = SelNum;
            }
            int RowsNum = 5;      //每行显示几条
            int TitleSize = 30;    //标题显示的条数
            //查询内容
            string strSelect;
            strSelect = " ID,Thumbnail as Picture,Name as Title,Price,AddDate";
            //查询条件 
            string strWhere = "[C_Supply].Verify=1 AND UserID= " + UserID;
            if (strType != "" || strType == null)
                strWhere += " and ProType=" + strType;
            if (strKey != "" || strKey == null)
                strWhere += " and Name like '%" + strKey + "%'";

            if (pName != "" || pName == null)
                strWhere += " and Name like '%" + pName + "%'";
            if (prestr != "")
            {
                strWhere += prestr;
            }
            // 要查询表、视图
            string strTableName = "C_Supply";
            // 排序方式
            string strOrderBy = " AddDate ";
            int PageIndex = 1;
            if (GetRequest.CheckQueryStringisInt("Page"))
                PageIndex = int.Parse(HttpContext.Current.Request.QueryString["Page"].ToString());
            // 返回查询结果
            DataTable Lists = Pagination.GetDataTable(strWhere.ToString(), strTableName, 1, strOrderBy, strSelect, Num, PageIndex, 0);
            StringBuilder strBuilder = new StringBuilder();
            if (Lists.Rows.Count <= 0)
                strBuilder.Append("还没有发布信息");
            else
            {
                strBuilder.Append(@"<ul class=""sprd"">");
                for (int i = 0; i < Lists.Rows.Count; i++)
                {
                    if (i > Num - 1) break; //如果超过显示的条数则跳出。

                    strBuilder.Append("<li><p><a href=\"{PB_WebURL}Supply/Detail-" + Lists.Rows[i]["ID"].ToString() + Base.BasePage.Config.Rewrite + "");
                    strBuilder.Append(" Target=\"_blank");
                    strBuilder.Append("\">");
                    strBuilder.Append("<img ");
                    strBuilder.Append(" src=\"");
                    strBuilder.Append(Function.ProcessImageUrl(Lists.Rows[i]["Picture"].ToString()));
                    strBuilder.Append("\">");
                    strBuilder.Append("</a></p><span><a title=\"\" Target=\"_blank\" href=\"{PB_WebURL}Supply/Detail-" + Lists.Rows[i]["ID"].ToString() + Base.BasePage.Config.Rewrite + "\" />");
                    if (TitleSize > 0)
                        if (Lists.Rows[i]["Title"].ToString().Length > TitleSize)
                            strBuilder.Append(Lists.Rows[i]["Title"].ToString().Substring(0, TitleSize));
                        else
                            strBuilder.Append(Lists.Rows[i]["Title"].ToString());
                    else
                        strBuilder.Append(Lists.Rows[i]["title"].ToString());
                    strBuilder.Append(@"</a></span>");
                    strBuilder.Append(@"<em>"+Lists.Rows[i]["AddDate"]+"</em>");
                    strBuilder.Append(@"</li>");
                }
                strBuilder.Append(@"</ul>");
            }

            if (HttpContext.Current.Request.QueryString["LoginName"] != "" && HttpContext.Current.Request.QueryString["LoginName"] != null)
            {
                lname = HttpContext.Current.Request.QueryString["LoginName"].ToString();
            }

            string strUrl = "{PB_WebUrl}Shop/Supply/" + lname + ".aspx?Page=";
            if (PageIndex <= 0)
                PageIndex = 1;
            string Pages = "";
            return strBuilder.ToString();
        }
        private static string GetCompMesg(int UserID,int type)
        {

            StringBuilder strBuilder = new StringBuilder();
            //查询内容
            string strSelect;
            strSelect = " a.*,datediff(year,a.RegDate,getdate()) as regtime,b.SupplyCount,b.PurchaseCount,b.ExpoCount";
            //查询条件 
            string strWhere = " where a.UserID= " + UserID;
            // 要查询表、视图
            string strTableName = " U_UserInfo as a left join dbo.U_UserOperate as b on a.UserID=b.UserID ";
            // 排序方式
            string strOrderBy = " ";
            // 返回查询结果
            DataTable Lists = nspLable.Function.Function.GetDataTable(strSelect, strWhere, strTableName, strOrderBy);
            if (type == 1)
            {
                if (Lists.Rows.Count != 0)
                {
                    string rtime = Lists.Rows[0]["regtime"].ToString();
                    if (rtime == "0")
                    {
                        rtime = "1";
                    }
                    strBuilder.Append("<div class=\"spk\">");
                    strBuilder.Append("<strong>企业档案</strong><div class=\"spkc\">");
                    strBuilder.Append("<p><span class=\"zi1\"><img alt=\"\" src=\"{PB_WebURL}ShopTemplate/{Shop_TEMPNAME}/images/mqhy_t.gif\" /></span>");
                    strBuilder.Append("<span class=\"zi2\">第<em>" + rtime + "</em>年</span></p>");
                    strBuilder.Append("<span class=\"line\"></span>");
                    strBuilder.Append("<p class=\"zi3 mar_top\">" + Lists.Rows[0]["CompanyName"].ToString() + "</p>");
                    strBuilder.Append("<p><span class=\"zi4\">" + Lists.Rows[0]["LinkName"].ToString() + "</span> " + Lists.Rows[0]["Sex"].ToString() + "</p>");
                    strBuilder.Append("<p>工商注册信息：<span class=\"zi4\">未认证</span></p>");
                    strBuilder.Append("<p>公司所在地：<span class=\"zi4\">" + Lists.Rows[0]["Province"].ToString() + " " + Lists.Rows[0]["City"].ToString() + "</span></p>");
                    strBuilder.Append("<p>供应信息数量：<span class=\"zi4\">" + Lists.Rows[0]["SupplyCount"].ToString() + " 条</span></p>");
                    strBuilder.Append("<span class=\"line\"></span>");
                    strBuilder.Append("<p class=\"mar_top\"><span class=\"zi5\"><a title=\"\" href=\"" + Base.BasePage.Config.WebURL + "Search/SaveFavorites.aspx?id=" + Lists.Rows[0]["UserID"] + "&Type=company\">收藏本公司</a></span><span class=\"zi6\"><a title=\"\" href=\"" + Base.BasePage.Config.WebURL + "Search/Quotation.aspx?userID=" + Lists.Rows[0]["UserID"] + "\">给我留言</a></span></p>");
                    strBuilder.Append("</div></div>");

                }
            }
            if (type == 2)
            {
                foreach (DataRow dr in Lists.Rows)
                {
                    strBuilder.Append("<div class=\"spnc\">");
                    strBuilder.Append("<p><b>" + dr["LinkName"] + "</b> " + dr["Position"] + "</a></p>");
                    strBuilder.Append("<p>电话：" + dr["Tel_International"] + "-" + dr["Tel_DistrictNumber"] + "-" + dr["Tel_Telephone"] + "</p>");
                    if (dr["Fax_Telephone"].ToString() != "")
                    {
                        strBuilder.Append("<p>传真：" + dr["Fax_International"] + "-" + dr["Fax_DistrictNumber"] + "-" + dr["Fax_Telephone"] + "</p>");
                    }
                    strBuilder.Append("</div>");
                }
            }
            
            return strBuilder.ToString();
        }

        private static string MinoCustomclass(int UserID, string LoginName,string type)
        {
            string strType = HttpContext.Current.Request.QueryString["Type"];
            //查询内容
            string strSelect;
            strSelect = "a.ID,a.Name,count(b.ID) as pcount ,c.SupplyCount ";
            //查询条件 
            string strWhere = "where b.Verify=1 and (datediff(hh,b.EndDate,getdate())<0) and a.UserID= " + UserID;
            // 要查询表、视图
            string strTableName = " C_ProType as a left join C_Supply as b  on a.ID=b.Protype and a.UserID=b.UserID left join U_UserOperate as c on a.UserID=c.UserID ";
            // 排序方式
            string strOrderBy = " group by a.ID,a.[Name],c.SupplyCount ";
            // 返回查询结果
            DataTable Lists = Function.GetDataTable(strSelect, strWhere.ToString(), strTableName, strOrderBy);
            StringBuilder strBuilder = new StringBuilder();
            strBuilder.Append("<ul class=\"spc4\">");
            if (Lists.Rows.Count != 0)
            {
                if (type == "Supply")
                {
                    strBuilder.Append("<li><a href=\"{PB_WebURL}Shop/Supply/" + LoginName + Base.BasePage.Config.Rewrite + "?Type=0\">");
                }
                if (type == "Buy")
                {
                    strBuilder.Append("<li><a href=\"{PB_WebURL}Shop/Buy/" + LoginName + Base.BasePage.Config.Rewrite + "?Type=0\">");
                }
                strBuilder.Append("全部 (" + Lists.Rows[0]["SupplyCount"].ToString() + ")");
                strBuilder.Append(@"</a>");
                strBuilder.Append(@"</li>");
            }
            foreach (DataRow dr in Lists.Rows)
            {
                strBuilder.Append("<li>");
                if (type == "Supply")
                {
                    strBuilder.Append("<a href=\"{PB_WebURL}Shop/Supply/" + LoginName + Base.BasePage.Config.Rewrite + "?Type=" + dr["ID"].ToString() + "\">");
                }
                if (type == "Buy")
                {
                    strBuilder.Append("<a href=\"{PB_WebURL}Shop/Buy/" + LoginName + Base.BasePage.Config.Rewrite + "?Type=" + dr["ID"].ToString() + "\">");
                }
                strBuilder.Append(dr["Name"].ToString() + "(" + dr["pcount"].ToString() + ")");
                strBuilder.Append(@"</a>");
                strBuilder.Append(@"</li>");
            }
            strBuilder.Append("</ul>");
            return strBuilder.ToString();
        }
        private static string MinoBuyCustomclass(int UserID, string LoginName)
        {
            string strType = HttpContext.Current.Request.QueryString["Type"];
            //查询内容
            string strSelect;
            strSelect = " distinct a.ID,a.[Type],c.PurchaseCount,count(b.ID) as pcount ";
            //查询条件 
            string strWhere = "where patindex('%,'+rtrim(a.[ID])+',%',','+ b.IndType+',')>0  and c.UserID=b.UserID and b.Verify=1 and (datediff(hh,b.EndDate,getdate())<0) and b.UserID= " + UserID;
            // 要查询表、视图
            string strTableName = " dbo.W_IndustryType as a ,  C_Purchase as b ,dbo.U_UserOperate as c ";
            // 排序方式
            string strOrderBy = " group by a.ID,a.[Type],c.PurchaseCount ";
            // 返回查询结果
            DataTable Lists = Function.GetDataTable(strSelect, strWhere.ToString(), strTableName, strOrderBy);
            StringBuilder strBuilder = new StringBuilder();
            strBuilder.Append("<ul class=\"spc4\">");
            if (Lists.Rows.Count != 0)
            {
                strBuilder.Append("<li><a href=\"{PB_WebURL}Shops/Buy" + Base.BasePage.Config.Rewrite + "?LoginName=" + LoginName + "&Type=0\">");
                strBuilder.Append("全部 (" + Lists.Rows[0]["PurchaseCount"].ToString() + ")");
                strBuilder.Append(@"</a>");
                strBuilder.Append(@"</li>");
            }
            foreach (DataRow dr in Lists.Rows)
            {
                string typename = dr["Type"].ToString();
                if (typename.Length > 10)
                {
                    typename = typename.Substring(0, 10);
                }
                strBuilder.Append("<li>");

                strBuilder.Append("<a href=\"{PB_WebURL}Shops/Buy" + Base.BasePage.Config.Rewrite + "?LoginName=" + LoginName + "&Type=" + dr["ID"].ToString() + "\">");

                strBuilder.Append(typename + "(" + dr["pcount"].ToString() + ")");
                strBuilder.Append(@"</a>");
                strBuilder.Append(@"</li>");
            }
            strBuilder.Append("</ul>");
            return strBuilder.ToString();
        }
        private static string MinoBuyProClass(int UserID, string LoginName)
        {
            //查询内容
            string strSelect;
            strSelect = "  distinct top 4 a.ID,a.[Type],c.PurchaseCount,count(b.ID) as pcount ";
            //查询条件 
            string strWhere = "where patindex('%,'+rtrim(a.[ID])+',%',','+ b.IndType+',')>0  and c.UserID=b.UserID and b.Verify=1 and (datediff(hh,b.EndDate,getdate())<0) and b.UserID= " + UserID;
            // 要查询表、视图
            string strTableName = " dbo.W_IndustryType as a ,  C_Purchase as b ,dbo.U_UserOperate as c ";
            // 排序方式
            string strOrderBy = " group by a.ID,a.[Type],c.PurchaseCount ";
            // 返回查询结果
            DataTable Lists = Function.GetDataTable(strSelect, strWhere.ToString(), strTableName, strOrderBy);
            StringBuilder strBuilder = new StringBuilder();
            strBuilder.Append("<ul class=\"spc1\">");
            if (Lists.Rows.Count != 0)
            {
                strBuilder.Append("<li><a href=\"{PB_WebURL}Shops/Buy" + Base.BasePage.Config.Rewrite + "?LoginName=" + LoginName + "&Type=0\">");
                strBuilder.Append("全部 (" + Lists.Rows[0]["PurchaseCount"].ToString() + ")");
                strBuilder.Append(@"</a>");
                strBuilder.Append(@"</li>");
            }
            foreach (DataRow dr in Lists.Rows)
            {
                string typename = dr["Type"].ToString();
                if (typename.Length > 10)
                {
                    typename = typename.Substring(0, 10);
                }
                strBuilder.Append("<li>");

                strBuilder.Append("<a href=\"{PB_WebURL}Shops/Buy" + Base.BasePage.Config.Rewrite + "?LoginName=" + LoginName + "&Type=" + dr["ID"].ToString() + "\">");

                strBuilder.Append(typename + "(" + dr["pcount"].ToString() + ")");
                strBuilder.Append(@"</a>");
                strBuilder.Append(@"</li>");
            }
            strBuilder.Append("</ul>");
            return strBuilder.ToString();
            
        }
        /// <summary>
        /// 产品分类(加的店铺模板产品分类)
        /// </summary>
        /// <param name="Summary"></param>
        /// <returns></returns>
        private static string MinoProductType(int UserID, string LoginName)
        {
            string strType = HttpContext.Current.Request.QueryString["Type"];
            //查询内容
            string strSelect;
            strSelect = " top 4 a.ID,a.Name,count(b.ID) as pcount ,c.SupplyCount ";
            //查询条件 
            string strWhere = "where  b.Verify=1 and (datediff(hh,b.EndDate,getdate())<0) and  a.UserID= " + UserID;
            // 要查询表、视图 
            string strTableName = " C_ProType as a left join C_Supply as b  on a.ID=b.Protype and a.UserID=b.UserID  left join U_UserOperate as c on a.UserID=c.UserID ";
            // 排序方式
            string strOrderBy = " group by a.ID,a.[Name],c.SupplyCount ";
            // 返回查询结果
            DataTable Lists = Function.GetDataTable(strSelect, strWhere.ToString(), strTableName, strOrderBy);
            StringBuilder strBuilder = new StringBuilder();
            if (Lists.Rows.Count > 0)
            {
                strBuilder.Append("<li>");
                strBuilder.Append("<a href=\"{PB_WebURL}Shop/Supply/" + LoginName + Base.BasePage.Config.Rewrite + "?Type=0\">");
                strBuilder.Append("全部 (" + Lists.Rows[0]["SupplyCount"].ToString() + ")");
                strBuilder.Append(@"</a>");
                strBuilder.Append(@"</li>");
                for (int i = 0; i < Lists.Rows.Count; i++)
                {
                    strBuilder.Append("<li>");
                    strBuilder.Append("<a href=\"{PB_WebURL}Shop/Supply/" + LoginName + Base.BasePage.Config.Rewrite + "?Type=" + Lists.Rows[i]["ID"].ToString() + "\">");
                    strBuilder.Append(Lists.Rows[i]["Name"].ToString() + "(" + Lists.Rows[i]["pcount"].ToString() + ")");
                    strBuilder.Append(@"</a>");
                    strBuilder.Append(@"</li>");
                }
            }
            else {
                strBuilder.Append("<li>");
                strBuilder.Append("<a href=\"{PB_WebURL}Shop/Supply/" + LoginName + Base.BasePage.Config.Rewrite + "?Type=0\">");
                strBuilder.Append("全部");
                strBuilder.Append(@"</a>");
                strBuilder.Append(@"</li>");
            }
            return strBuilder.ToString();
        }

        private static string MinoFriendLink(int UserID)
        {
            //查询内容
            string strSelect;
            strSelect = " top 8  ID,Name,Url,Verify,AddDate ";
            //查询条件 
            string strWhere = "where UserID= " + UserID+" and verify=1 ";
            // 要查询表、视图
            string strTableName = " U_UserLink ";
            // 排序方式
            string strOrderBy = " order by AddDate desc ";
            // 返回查询结果
            DataTable Lists = Function.GetDataTable(strSelect, strWhere.ToString(), strTableName, strOrderBy);
            StringBuilder strBuilder = new StringBuilder();
            foreach (DataRow dr in Lists.Rows)
            {
                strBuilder.Append("<li>▪&nbsp;<a title=\"\" href=\"" + dr["Url"] + "\">" + dr["Name"] + "</a></li>");
            }
            return strBuilder.ToString();
        }

        /// <summary>
        /// 底部信息
        /// </summary>
        /// <param name="dtList">公司表</param>
        /// <returns></returns>
        private static string Bottom(DataTable dtList)
        {
            StringBuilder strBuilder1 = new StringBuilder();
            strBuilder1.Append("<div class=\"cot\">\r\n");
            strBuilder1.Append("  <div class=\"foot mar_top\">\r\n");
            strBuilder1.Append("<p><a href=\"{PB_WebURL}Shop/Index/{Shop_WebName}\">首页</a>&nbsp;&nbsp;|&nbsp;&nbsp;");
            strBuilder1.Append("<a href=\"{PB_WebURL}Shop/Supply/{Shop_WebName}\">供应产品</a>&nbsp;&nbsp;|&nbsp;&nbsp;");
            strBuilder1.Append("<a href=\"{PB_WebURL}Shop/Profile/{Shop_WebName}\">公司介绍</a>&nbsp;&nbsp;|&nbsp;&nbsp;");
            strBuilder1.Append("<a href=\"{PB_WebURL}Shop/Newslist/{Shop_WebName}\">产品动态</a>&nbsp;&nbsp;|&nbsp;&nbsp;");
            strBuilder1.Append("<a href=\"{PB_WebURL}Shop/Certify/{Shop_WebName}\">诚信档案</a>&nbsp;&nbsp;|&nbsp;&nbsp;");
            //strBuilder1.Append("<a href=\"{PB_WebURL}Shop/Onlone/{Shop_WebName}\">在线留言</a>&nbsp;&nbsp;|&nbsp;&nbsp;");
            strBuilder1.Append("<a href=\"{PB_WebURL}Shop/Contact/{Shop_WebName}\">联系方式</a></p>");
            strBuilder1.Append("<p>" + dtList.Rows[0]["CompanyName"].ToString() + "</p>");
            strBuilder1.Append("<p>地址：");
            strBuilder1.Append(dtList.Rows[0]["Country"].ToString());
            strBuilder1.Append(dtList.Rows[0]["Province"].ToString());
            strBuilder1.Append(dtList.Rows[0]["City"].ToString());
            strBuilder1.Append(dtList.Rows[0]["Area"].ToString());
            strBuilder1.Append(dtList.Rows[0]["Street"].ToString());
            strBuilder1.Append("</p>");
            strBuilder1.Append("<p>技术支持：<a href=\"" + "{PB_WEBURL}" + "\">" + "{PB_WEBNAME}" + "</a></p>");
            strBuilder1.Append("  </div>");
            strBuilder1.Append("</div>");
            string str = strBuilder1.ToString();
            return str;
        }


        /// <summary>
        /// 公司证书
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        private static string Certify(int UserID)
        {
            string keyword = "";
            if (HttpContext.Current.Request.QueryString["keyword"] != null)
            {
                keyword = System.Web.HttpUtility.UrlDecode(HttpContext.Current.Request.QueryString["keyword"]).ToString();
            }
            string Restr = "";
            //查询内容
            string strSelect;
            strSelect = " Name,Url,Organization,LicenceDate,ExpiryDate";
            //查询条件 
            string strWhere = " where UserID= " + UserID;
            if (keyword != "")
            {
                strWhere += " and Name like '%" + keyword + "%'";
            }
            // 要查询表、视图
            string strTableName = " C_Certificate ";
            // 排序方式
            string strOrderBy = " Order by AddDate desc ";
            // 返回查询结果
            DataTable Lists = nspLable.Function.Function.GetDataTable(strSelect, strWhere, strTableName, strOrderBy);
            StringBuilder strBuilder = new StringBuilder();
            if (Lists.Rows.Count <= 0)
                strBuilder.Append("还没有相关链接");
            else
            {
                strBuilder.Append("<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"edtb\"><thead>");
                strBuilder.Append("<tr><td>证书图片</td>");
                strBuilder.Append("<td >证书名称</td>");
                strBuilder.Append("<td >发证机构</td>");
                strBuilder.Append("<td >生效日期</td>");
                strBuilder.Append("<td >截止日期</td></tr></thead><tbody>");
                for (int i = 0; i < Lists.Rows.Count; i++)
                {
                    strBuilder.Append("<tr><td>");
                    strBuilder.Append(@"<a href='");
                    strBuilder.Append(Function.ProcessImageUrl(Lists.Rows[i]["Url"].ToString()));
                    strBuilder.Append(@"'target='_blank'><img src='");
                    strBuilder.Append(Function.ProcessImageUrl(Lists.Rows[i]["Url"].ToString()));
                    strBuilder.Append(@"' width='120' height='80'></a></td>");

                    strBuilder.Append("<td>");
                    strBuilder.Append(@"<a href='");
                    strBuilder.Append(Function.ProcessImageUrl(Lists.Rows[i]["Url"].ToString()));
                    strBuilder.Append(@"'target='_blank'>");
                    strBuilder.Append(Lists.Rows[i]["Name"].ToString());
                    strBuilder.Append(@"</a></td>");

                    strBuilder.Append("<td>");
                    strBuilder.Append(Lists.Rows[i]["Organization"].ToString());
                    strBuilder.Append(@"</td>");

                    strBuilder.Append("<td>");
                    strBuilder.Append(Base.Common.DateTransform(Lists.Rows[i]["LicenceDate"].ToString(), 1));
                    strBuilder.Append(@"</td>");

                    strBuilder.Append("<td>");
                    strBuilder.Append(Base.Common.DateTransform(Lists.Rows[i]["ExpiryDate"].ToString(), 1));
                    strBuilder.Append(@"</td></tr>");
                }
                strBuilder.Append(@"</tbody></table>");
            }
            return strBuilder.ToString();
        }


        /// <summary>
        /// 公司供应
        /// </summary>
        /// <param name="UserID">公司ID</param>
        /// <param name="p">获得供应的哪种信息(0：全部信息；1：产品类别信息；2：查询信息)</param>
        /// <returns></returns>
        private static string Supply(string UserID)
        {

            string strType = "";
            string strKey = "";
            if (HttpContext.Current.Request.QueryString.AllKeys.Length == 2)
            {
                if (GetRequest.CheckQueryStringisInt("Type"))
                    strType = HttpContext.Current.Request.QueryString["Type"].ToString();
                else if (HttpContext.Current.Request.QueryString["keywords"] != "" && HttpContext.Current.Request.QueryString["keywords"] != null)
                    strKey = HttpContext.Current.Request.QueryString["keywords"].ToString();
            }
            int Num = 10;         //共显示的条数
            int RowsNum = 5;      //每行显示几条
            int TitleSize = 30;    //标题显示的条数
            //查询内容
            string strSelect;
            strSelect = " ID,Thumbnail as Picture,Name as Title";
            //查询条件 
            string strWhere = "[C_Supply].Verify=1 AND UserID= " + UserID;
            if (strType != "" || strType == null)
                strWhere += " and ProType=" + strType;
            if (strKey != "" || strKey == null)
                strWhere += " and Name like '%" + strKey + "%'";
            // 要查询表、视图
            string strTableName = "C_Supply";
            // 排序方式
            string strOrderBy = " AddDate ";
            int PageIndex = 1;
            if (GetRequest.CheckQueryStringisInt("Page"))
                PageIndex = int.Parse(HttpContext.Current.Request.QueryString["Page"].ToString());
            // 返回查询结果
            DataTable Lists = Pagination.GetDataTable(strWhere.ToString(), strTableName, 1, strOrderBy, strSelect, Num, PageIndex, 0);
            StringBuilder strBuilder = new StringBuilder();
            if (Lists.Rows.Count <= 0)
                strBuilder.Append("还没有发布信息");
            else
            {
                strBuilder.Append("<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr><td>");
                for (int i = 0; i < Lists.Rows.Count; i++)
                {
                    if (i > Num - 1) break; //如果超过显示的条数则跳出。
                    strBuilder.Append("<div class=\"quality\">");
                    strBuilder.Append("<div class=\"flay\"><a href=\"{PB_WebURL}Supply/detail.aspx?ID=");
                    strBuilder.Append(Lists.Rows[i]["ID"].ToString());
                    strBuilder.Append("\" Target=\"_blank");
                    //strBuilder.Append(Target);
                    strBuilder.Append("\">");
                    strBuilder.Append("<img width=\"");
                    strBuilder.Append(80);
                    strBuilder.Append("\" height=\"");
                    strBuilder.Append(100);
                    strBuilder.Append("\" src=\"");
                    strBuilder.Append(Function.ProcessImageUrl(Lists.Rows[i]["Picture"].ToString()));
                    strBuilder.Append("\"></a></div>");
                    strBuilder.Append("<p><a href=\"{PB_WebURL}Supply/detail.aspx?ID=");
                    strBuilder.Append(Lists.Rows[i]["ID"].ToString());
                    strBuilder.Append("\" Target=\"_blank");
                    //strBuilder.Append(Target);
                    strBuilder.Append("\">");
                    if (TitleSize > 0)
                        if (Lists.Rows[i]["Title"].ToString().Length > TitleSize)
                            strBuilder.Append(Lists.Rows[i]["Title"].ToString().Substring(0, TitleSize));
                        else
                            strBuilder.Append(Lists.Rows[i]["Title"].ToString());
                    else
                        strBuilder.Append(Lists.Rows[i]["title"].ToString());
                    strBuilder.Append(@"</a></p>");

                    strBuilder.Append(@"</div>");
                    if (((i + 1) % RowsNum) == 0)  //换行
                        if (i == (Num - 1) || i == Lists.Rows.Count - 1)
                            strBuilder.Append(@"</td></tr></table> ");
                        else
                            strBuilder.Append(@"</td></tr><tr><td>");
                    else
                        if (i == (Num - 1) || i == Lists.Rows.Count - 1)
                            strBuilder.Append(@"</td></tr></table> ");
                        else
                            strBuilder.Append(@"</td><td>");
                }
            }
            string strUrl = "{PB_WebUrl}Shop/Supply/websen.aspx?Page=";
            if (PageIndex <= 0)
                PageIndex = 1;
            string Pages = "";
            Pages = Pagination.GoToPager(PageIndex, Num, strUrl, strWhere.ToString(), strTableName, 0);
            strBuilder.Append(Pages);
            return strBuilder.ToString();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        private static string SupplyList(string UserID)
        {
            return "";
        }


        /// <summary>
        /// 公司简介
        /// </summary>
        /// <param name="Summary"></param>
        /// <returns></returns>
        private static string ComPanySummary(string LoginName)
        {
            //查询内容
            string strSelect;
            strSelect = "top 1 Summary";
            //查询条件 
            string strWhere = "where LoginName= '" + LoginName + "' ";
            // 要查询表、视图
            string strTableName = "U_UserInfo";
            // 排序方式
            string strOrderBy = "";
            // 返回查询结果
            DataTable Lists = Function.GetDataTable(strSelect, strWhere.ToString(), strTableName, strOrderBy);
            StringBuilder strBuilder = new StringBuilder();
            strBuilder.Append(Lists.Rows[0]["Summary"].ToString());
            return strBuilder.ToString();
        }


        /// <summary>
        /// 推荐产品
        /// </summary>
        /// <param name="UserID">公司ID</param>
        /// <param name="p">获得供应的哪种信息</param>
        /// <returns></returns>
        private static string Recommend(string UserID, int p)
        {
            string Restr = "";
            int Num = 15;         //共显示的条数
            int RowsNum = 15;      //每行显示几条
            int TitleSize = 8;    //标题显示的条数
            //查询内容
            string strSelect;
            strSelect = " ID,Thumbnail as Picture,Name as Title";
            //查询条件 
            string strWhere = " UserID= '" + UserID + "' AND [C_Supply].Verify=1 AND Recommend=1 ";
            // 要查询表、视图
            string strTableName = "C_Supply";
            // 排序方式
            string strOrderBy = " AddDate ";
            // 返回查询结果
            DataTable Lists = Pagination.GetDataTable(strWhere.ToString(), strTableName, 1, strOrderBy, strSelect, 15, 1, 0);
            StringBuilder strBuilder = new StringBuilder();
            if (Lists.Rows.Count <= 0)
                strBuilder.Append("还没有发布信息");
            else
            {
                strBuilder.Append("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td>");
                for (int i = 0; i < Lists.Rows.Count; i++)
                {
                    if (i > Num - 1) break; //如果超过显示的条数则跳出。
                    strBuilder.Append("<div class=\"quality\">");
                    strBuilder.Append("<div class=\"flay\"><a href=\"{PB_WebURL}supply/detail.aspx?ID=");
                    strBuilder.Append(Lists.Rows[i]["ID"].ToString());
                    strBuilder.Append("\" Target=\"_blank\">");
                    strBuilder.Append("<img width=\"");
                    strBuilder.Append(80);
                    strBuilder.Append("\" height=\"");
                    strBuilder.Append(100);
                    strBuilder.Append("\" src=\"");
                    strBuilder.Append(Function.ProcessImageUrl(Lists.Rows[i]["Picture"].ToString()));
                    strBuilder.Append("\"></a></div>");
                    strBuilder.Append("<p><a href=\"{PB_WebURL}supply/detail.aspx?ID=");
                    strBuilder.Append(Lists.Rows[i]["ID"].ToString());
                    strBuilder.Append("\" Target=\"_blank\" class=\"c1\">");
                    if (TitleSize > 0)
                        if (Lists.Rows[i]["Title"].ToString().Length > TitleSize)
                            strBuilder.Append(Lists.Rows[i]["Title"].ToString().Substring(0, TitleSize));
                        else
                            strBuilder.Append(Lists.Rows[i]["Title"].ToString());
                    else
                        strBuilder.Append(Lists.Rows[i]["title"].ToString());
                    strBuilder.Append(@"</a></p>");

                    strBuilder.Append(@"</div>");

                    if (((i + 1) % RowsNum) == 0)  //换行
                        if (i == (Num - 1) || i == Lists.Rows.Count - 1)
                            strBuilder.Append(@"</td></tr></table> ");
                        else
                            strBuilder.Append(@"</td></tr><tr><td>");
                    else
                        if (i == (Num - 1) || i == Lists.Rows.Count - 1)
                            strBuilder.Append(@"</td></tr></table> ");
                        else
                            strBuilder.Append(@"</td><td>");
                }
            }
            return strBuilder.ToString();
        }


        /// <summary>
        /// 联系方式
        /// </summary>
        /// <param name="UserID">会员ID</param>
        /// <returns></returns>
        private static string Contact(int UserID)
        {
            //查询内容
            string strSelect;
            strSelect = " * ";
            //查询条件 
            string strWhere = " where UserID= " + UserID;
            // 要查询表、视图
            string strTableName = " U_UserInfo ";
            // 排序方式
            string strOrderBy = " ";
            // 返回查询结果
            DataTable Lists = nspLable.Function.Function.GetDataTable(strSelect, strWhere, strTableName, strOrderBy);
            StringBuilder strBuilder = new StringBuilder();
            if (Lists.Rows.Count <= 0)
                strBuilder.Append("还没有会员信息");
            else
            {

                strBuilder.Append("<div class=\"spc7\">");
                strBuilder.Append("<strong>" + Lists.Rows[0]["CompanyName"].ToString() + "</strong>");
                strBuilder.Append("<p class=\"mar_top\"><b>" + Lists.Rows[0]["LinkName"].ToString() + "</b> " + Lists.Rows[0]["Position"].ToString() + "</p>");
                strBuilder.Append("<p>地    址：" + Lists.Rows[0]["Country"].ToString() + "." + Lists.Rows[0]["Province"].ToString() + "." + Lists.Rows[0]["City"].ToString() + "." + Lists.Rows[0]["DealinAdd"].ToString() + "</p>");
                if (Lists.Rows[0]["Postalcode"].ToString() != "")
                {
                    strBuilder.Append("<p>邮政编码：" + Lists.Rows[0]["Postalcode"].ToString() + "</p>");
                }
                strBuilder.Append("<p>电    话：" + Lists.Rows[0]["Tel_International"].ToString() + "-" + Lists.Rows[0]["Tel_DistrictNumber"].ToString() + "-" + Lists.Rows[0]["Tel_Telephone"].ToString() + " 传    真：" + Lists.Rows[0]["Fax_International"].ToString() + "-" + Lists.Rows[0]["Fax_DistrictNumber"].ToString() + "-" + Lists.Rows[0]["Fax_Telephone"].ToString() + "</p>");
                if (Lists.Rows[0]["URL"].ToString() != "")
                {
                    strBuilder.Append("<p>公司主页：<a  href=\"" + Lists.Rows[0]["URL"].ToString() + "\" target=\"_blank\">" + Lists.Rows[0]["URL"].ToString() + "</a></p>");
                }
                strBuilder.Append("</div>");
            }
            return strBuilder.ToString();
        }


        /// <summary>
        /// 版权
        /// </summary>
        /// <returns></returns>
        private static string Copyright(int UserID)
        {
            string Restr = "";
            return Restr;
        }


        /// <summary>
        ///  友情链接竖排
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        private static string Link_Row(int UserID)
        {
            string Restr = "";
            //查询内容
            string strSelect;
            strSelect = " Name,Url,Verify,Logo";
            //查询条件 
            string strWhere = " where Verify=1 AND UserID= " + UserID;
            // 要查询表、视图
            string strTableName = " U_UserLink ";
            // 排序方式
            string strOrderBy = " Order by AddDate desc ";
            // 返回查询结果
            DataTable Lists = nspLable.Function.Function.GetDataTable(strSelect, strWhere, strTableName, strOrderBy);
            StringBuilder strBuilder = new StringBuilder();
            if (Lists.Rows.Count <= 0)
                strBuilder.Append("暂时没有添加友情链接！");
            else
            {
                strBuilder.Append("<table width='100%'>");
                for (int i = 0; i < Lists.Rows.Count; i++)
                {
                    strBuilder.Append("<tr><td>");
                    strBuilder.Append(@"<a href='");
                    strBuilder.Append(Lists.Rows[i]["Url"].ToString());
                    strBuilder.Append(@"'>");
                    strBuilder.Append(Lists.Rows[i]["Name"].ToString());
                    strBuilder.Append(@"</a></td></tr>");
                }
                strBuilder.Append(@"</table>");
            }
            return strBuilder.ToString();
        }


        /// <summary>
        /// 公司详细信息
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        private static string CompanyInfo(DataTable strTable)
        {
            StringBuilder strBuilder = new StringBuilder();
            strBuilder.Append("<table width='100%'>");

            strBuilder.Append(@"<tr>");
            strBuilder.Append(@"<td width='17%'>主营产品或服务：</td><td width='33%'>" + strTable.Rows[0]["Product"].ToString() + @"</td>");     //主营产品或服务
            strBuilder.Append(@"<td width='17%'>主营行业：</td><td width='33%'>" + strTable.Rows[0]["Industry"].ToString() + @"</td>");           //主营行业
            strBuilder.Append(@"</tr><tr>");
            strBuilder.Append(@"<td width='17%'>企业类型：</td><td width='33%'>" + strTable.Rows[0]["CompanyName"].ToString() + @"</td>");     //企业类型
            strBuilder.Append(@"<td width='17%'>经营模式：</td><td width='33%'>" + strTable.Rows[0]["BusinessModel"].ToString() + @"</td>");     //经营模式
            strBuilder.Append(@"</tr><tr>");
            strBuilder.Append(@"<td width='17%'>注册地址：</td><td width='33%'>" + strTable.Rows[0]["RegisterAddress"].ToString() + @"</td>");     //注册地址
            strBuilder.Append(@"<td width='17%'>经营地址：</td><td width='33%'>" + strTable.Rows[0]["DealinAdd"].ToString() + @"</td>");     //经营地址
            strBuilder.Append(@"</tr><tr>");
            strBuilder.Append(@"<td width='17%'>经营品牌：</td><td width='33%'>" + strTable.Rows[0]["CompanyName"].ToString() + @"</td>");     //经营品牌
            strBuilder.Append(@"<td width='17%'>法定代表人/负责人：</td><td width='33%'>" + strTable.Rows[0]["Corporate"].ToString() + @"</td>");     //法定代表人/负责人
            strBuilder.Append(@"</tr><tr>");
            strBuilder.Append(@"<td >公司主页：</td>");     //主营产品或服务
            strBuilder.Append(@"<td colspan='3' ><a href='{PB_WebURL}Shop/index/" + strTable.Rows[0]["LoginName"].ToString() + @".html'>{PB_WebURL}Shop/index/" + strTable.Rows[0]["LoginName"].ToString() + @".html</a></td>");     //主营行业
            strBuilder.Append(@"</tr>");

            strBuilder.Append(@"</table>");

            return strBuilder.ToString();
        }


        /// <summary>
        /// 产品分类
        /// </summary>
        /// <param name="Summary"></param>
        /// <returns></returns>
        private static string ProductType(int UserID, string LoginName)
        {
            string strType = HttpContext.Current.Request.QueryString["Type"];
            //查询内容
            string strSelect;
            strSelect = "ID,Name";
            //查询条件 
            string strWhere = "where UserID= " + UserID;
            // 要查询表、视图
            string strTableName = "C_ProType";
            // 排序方式
            string strOrderBy = "order by Sequence desc";
            // 返回查询结果
            DataTable Lists = Function.GetDataTable(strSelect, strWhere.ToString(), strTableName, strOrderBy);
            StringBuilder strBuilder = new StringBuilder();

            if (Lists.Rows.Count > 0)
            {
                strBuilder.Append("<div class=\"bodyContent\"><ul>");
                for (int i = 0; i < Lists.Rows.Count; i++)
                {
                    strBuilder.Append("<li>");
                    strBuilder.Append("<a href=\"../Supply/" + LoginName + Base.BasePage.Config.Rewrite + "?Type=" + Lists.Rows[i]["ID"].ToString() + "\">");
                    strBuilder.Append(Lists.Rows[i]["Name"].ToString());
                    strBuilder.Append(@"</a>");
                    strBuilder.Append(@"</li>");
                }
                strBuilder.Append("</ul></div><div class=\"clr\"></div>");
            }
            else
            {
                strBuilder.Append(@"该会员没有产品分类");
            }
            return strBuilder.ToString();
        }


        /// <summary>
        /// 公司新闻
        /// </summary>
        /// <param name="Summary"></param>
        /// <returns></returns>
        private static string NewsList(int UserID, string LoginName, string parame, string strType)
        {
            //string strType = HttpContext.Current.Request.QueryString["Type"];
            //查询内容
            string strSelect = "";
            if (parame != "" && parame != "0")
            {
                strSelect += " top " + parame;
            }
            strSelect += " ID,Title,Adddate";
            //查询条件 
            string strWhere = "where Verify=1 AND UserID= " + UserID;
            // 要查询表、视图
            string strTableName = "C_News";
            // 排序方式
            string strOrderBy = " ";
            // 返回查询结果
            DataTable Lists = Function.GetDataTable(strSelect, strWhere.ToString(), strTableName, strOrderBy);
            StringBuilder strBuilder = new StringBuilder();

            if (Lists.Rows.Count > 0)
            {
                strBuilder.Append("<table width=\"100%\" border=\"0\" cellsapcing=\"0\" cellpadding=\"0\">");
                for (int i = 0; i < Lists.Rows.Count; i++)
                {
                    strBuilder.Append(@"<tr><td>");
                    strBuilder.Append(@"·<a href='../NewsInfo/" + LoginName + Base.BasePage.Config.Rewrite + "?id=" + Lists.Rows[i]["ID"].ToString() + "'>");
                    strBuilder.Append(Lists.Rows[i]["Title"].ToString());
                    strBuilder.Append(@"</a></td>");
                    if (strType.ToUpper() != "1")
                    {
                        strBuilder.Append("<td align=\"right\">" + Lists.Rows[i]["Adddate"].ToString() + "</td>");
                    }
                    strBuilder.Append(@"</tr>");
                }
                strBuilder.Append(@"</table>");
            }
            else
            {
                strBuilder.Append(@"暂无公司新闻");
            }
            return strBuilder.ToString();
        }


        /// <summary>
        /// 站内收索
        /// </summary>
        /// <param name="pathName">模板路径</param>
        /// <returns></returns>
        private static string Search(string LoginName)
        {

            string PathName = AppDomain.CurrentDomain.BaseDirectory.ToString() + "Shops/search.js";
            StringBuilder builder = new StringBuilder();
            string str = "";
            using (StreamReader reader = new StreamReader(PathName, Encoding.Default))
            {
                StringBuilder builder2 = new StringBuilder();
                builder2.Append(reader.ReadToEnd());
                reader.Close();
                str = builder2.ToString().Replace("{SHOP_ReURL}", "../Supply/" + LoginName + Base.BasePage.Config.Rewrite + "?keywords=");
            }
            return str;
        }


        /// <summary>
        /// 
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        private static string NewsInfo(string UserID)
        {
            string strType = HttpContext.Current.Request.QueryString["id"];
            //查询内容
            string strSelect = "";
            strSelect += " ID,Title,Info,Adddate";
            //查询条件 
            string strWhere = "where verify=1 and UserID= " + UserID + " and id=" + strType;
            // 要查询表、视图
            string strTableName = "C_News";
            // 排序方式
            string strOrderBy = " ";
            // 返回查询结果
            DataTable Lists = Function.GetDataTable(strSelect, strWhere.ToString(), strTableName, strOrderBy);
            StringBuilder strBuilder = new StringBuilder();
            if (Lists.Rows.Count > 0)
            {
                strBuilder.Append("<ul><li class=\"t\">");
                strBuilder.Append(Lists.Rows[0]["Title"].ToString());
                strBuilder.Append("</li><li class=\"c\">");
                strBuilder.Append(Lists.Rows[0]["Info"].ToString());
                strBuilder.Append("</li></ul>");
            }
            else
            {
                strBuilder.Append("<ul><li>该公司动态不存在或没有通过审核！</li></ul>");
            }
            return strBuilder.ToString();
        }

        /// <summary>
        /// 企业招聘列表
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        private static string JobList(string UserID,string LoginName)
        {
            string keyword = "";
            if (HttpContext.Current.Request.QueryString["keyword"] != null)
            {
                keyword = System.Web.HttpUtility.UrlDecode(HttpContext.Current.Request.QueryString["keyword"]).ToString();
            }

            //查询内容
            string strSelect = " [C_Job].*,[C_JobType].TypeName ";
            //查询条件 
            string strWhere = "  [C_Job].Verify=1 AND [C_Job].UserID= " + UserID + " AND [C_Job].TypeID=[C_JobType].ID";
            if (keyword != "")
            {
                strWhere += " and [C_Job].Position like '%" + keyword + "%'";
            }
            // 要查询表、视图
            string strTableName = " [C_Job],[C_JobType] ";
            // 排序方式
            string strOrderBy = " ";
            int PageSize = 15;
            int PageIndex = 0;
            if (HttpContext.Current.Request.QueryString["Page"] != null)
                PageIndex = Convert.ToInt32(HttpContext.Current.Request.QueryString["Page"]);
            if (PageIndex < 1) PageIndex = 1;
            // 返回查询结果
            int Count = 0;
            string OrderField = " [C_Job].AddDate ";
            int OrderType = 1;
            DataTable Lists = nspLable.Function.Pagination.GetDataTable(strWhere, strTableName, OrderType, OrderField, strSelect, PageSize, PageIndex, Count, "ID");
            StringBuilder strBuilder = new StringBuilder();
            if (Lists.Rows.Count > 0)
            {
                strBuilder.Append("<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"edtb\"><thead>");
                strBuilder.Append("<tr><td >职位名称</td>");
                strBuilder.Append("<td >截止日期</td>");
                strBuilder.Append("<td >工作地点</td>");
                strBuilder.Append("<td >学历</td>");
                strBuilder.Append("<td >工作经验</td>");
                strBuilder.Append("<td >性质</td>");
                strBuilder.Append("<td >人数</td>");
                strBuilder.Append("<td >&nbsp;</td></tr></thead><tbody>");
                for (int i = 0; i < Lists.Rows.Count; i++)
                {
                    strBuilder.Append("<tr>");
                    //strBuilder.Append("<td>");
                    //strBuilder.Append("<a href=\"{PB_WebUrl}Job/JobTrade-" + Lists.Rows[i]["TypeID"].ToString() + BasePage.Config.Rewrite + "\">" + Lists.Rows[i]["TypeName"].ToString() + "</a>");
                    //strBuilder.Append(@"</td>");

                    strBuilder.Append("<td>");
                    strBuilder.Append("<a href=\"{PB_WEBURL}Job/JobDetail-" + Lists.Rows[i]["ID"].ToString() + BasePage.Config.Rewrite + "\">" + Lists.Rows[i]["Position"].ToString() + "</a>");
                    strBuilder.Append(@"</td>");

                    strBuilder.Append("<td>");
                    strBuilder.Append(DateTime.Parse(Lists.Rows[i]["EndDate"].ToString()).ToShortDateString());
                    strBuilder.Append(@"</td>");


                    strBuilder.Append("<td>");
                    strBuilder.Append(Lists.Rows[i]["Address"].ToString());
                    strBuilder.Append(@"</td>"); 

                    strBuilder.Append("<td>");
                    strBuilder.Append(Lists.Rows[i]["Degree"].ToString());
                    strBuilder.Append(@"</td>");

                    strBuilder.Append("<td>");
                    strBuilder.Append(Lists.Rows[i]["Experience"].ToString());
                    strBuilder.Append(@"</td>");

                    strBuilder.Append("<td>");
                    strBuilder.Append(Lists.Rows[i]["WorkTemper"].ToString());
                    strBuilder.Append(@"</td>");

                    strBuilder.Append("<td>");
                    strBuilder.Append(Lists.Rows[i]["Count"].ToString());
                    strBuilder.Append(@"</td>");

                    strBuilder.Append("<td><span class=\"zpan\"><a title=\"\" href=\"#\">立即申请</a></span></td>");
                    strBuilder.Append("</tr>");
                }
                strBuilder.Append(@"</tbody></table>");

                string strUrl = Base.BasePage.Config.WebURL + "Shops/Job" + Base.BasePage.Config.Rewrite + "?LoginName=" + LoginName + "";

                if (keyword != "")
                {
                    strUrl += "&keyword=" + keyword;
                }
                strUrl += "&Page=";
                string Pages = Pagination.GoToPagerCompany(PageIndex, PageSize, strUrl, strWhere, strTableName);
                strBuilder.Append(Pages);
            }
            else
            {
                strBuilder.Append("<ul><li>该公司暂时没有招聘信息!</li></ul>");
            }
            return strBuilder.ToString();
        }
    }
}
